Let $\mathbf{a} = \begin{pmatrix} 5 \\ 1 \end{pmatrix}$ and $\mathbf{b} = \begin{pmatrix} 2 \\ 4 \end{pmatrix}.$  Find the area of the triangle with vertices $\mathbf{0},$ $\mathbf{a},$ and $\mathbf{b}.$
The area of the triangle formed by $\mathbf{0},$ $\mathbf{a},$ and $\mathbf{b}$ is half the area of the parallelogram formed by $\mathbf{0},$ $\mathbf{a},$ $\mathbf{b},$ and $\mathbf{a} + \mathbf{b}.$

[asy]
unitsize(0.8 cm);

pair A, B, O;

A = (5,1);
B = (2,4);
O = (0,0);

draw(O--A,Arrow(6));
draw(O--B,Arrow(6));
draw(A--B--(A + B)--cycle,dashed);
draw((-1,0)--(8,0));
draw((0,-1)--(0,6));

label("$\mathbf{a}$", A, SE);
label("$\mathbf{b}$", B, NW);
label("$\mathbf{a} + \mathbf{b}$", A + B, NE);
label("$\mathbf{0}$", O, SW);
[/asy]

The area of the parallelogram formed by $\mathbf{0},$ $\mathbf{a},$ $\mathbf{b},$ and $\mathbf{a} + \mathbf{b}$ is
\[|(5)(4) - (2)(1)| = 18,\]so the area of the triangle is $18/2 = \boxed{9}.$